package com.heima.wemedia.client;

import com.heima.model.media.dtos.WmUserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 自媒体服务的feign客户端
 */
@FeignClient("leadnews-wemedia")
public interface WemediaFeignClient {

    /**
     * 新增自媒体账号
     * 返回自媒体账号的id
     */
    @PostMapping("/api/v1/wmuser/save")
    Integer save(@RequestBody WmUserDto wmUserDto);

    /**
     * 通过用户id查询自媒体账号
     */
    @GetMapping("/api/v1/wmuser/findByApUserId/{id}")
    WmUserDto findByApUserId(@PathVariable("id") Integer id);
}
